#include <iostream>
using namespace std;
int main()
{
long long int n, k,temp;
cin >> n >> k;
if(n%2==0)
{
if (k <= n / 2)
{
temp = 2 * k - 1;
cout << temp << endl;
}
else
{ temp = 2 * (k - n / 2);
cout << temp << endl;
}
}
else
{
if (k <= n / 2+1)
{
temp = 2 * k - 1;
cout << temp << endl;
}
else
{
temp = 2 * (k - n / 2-1);
cout << temp << endl;
}
}
return 0;
}